package com.charlotte.gupao.study.support;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;


/**
 * @author junjie.ding
 * @date 2020/10/29 20:39
 * @description TODO
 */
public class AmqpConnection {

    private final static String url = "amqp://test:test@10.217.126.205:5672";

    public static Connection getConnection() throws Exception{
        ConnectionFactory factory = new ConnectionFactory();
        factory.setUri(url);
        // 建立连接
        return factory.newConnection();
    }
}
